<script type="text/javascript">
	window.addEvent('domready', function(){
		$('main').getElements("select[name=order_status]").addEvent('change', function(){
			
			if ($('main').getElements("select[name=order_status]").get('value') == '6')
			{
				$('odr_cancel_comments').setStyle('display', 'block');
			}
			else
			{
				$('odr_cancel_comments').setStyle('display', 'none');
			}
		});
	});
</script>
<form method="post" class="tl_form" action="typolight/main.php?do=orderlist">
<div class="tl_formbody">
<input type="hidden" value="tl_filters" name="FORM_SUBMIT">

<div id="tl_buttons">
	<a title="Go back" class="header_back" href="typolight/main.php?do=orderlist">Go back</a>
</div>
<br />

<div class="tl_panel">

<div class="tl_submit_panel tl_subpanel">
<input type="image" value="apply changes" title="Apply" class="tl_img_submit" src="system/themes/default/images/reload.gif" id="filter" name="filter_show">
</div>

<div class="tl_limit tl_subpanel">
<strong>Show:</strong>
<select class="tl_select active" name="tl_limit">
  <option value="">Records</option>
  <?php if ($this->orderCnt > 30): ?>
  <?php 
	$intQuotient = floor($this->orderCnt / 30);
	$intResidue = $this->orderCnt % 30;
	//print_r($this->limitValue);exit;
  ?>
  <?php for ($i = 0;$i < $intQuotient; $i++): ?>
  <option<?php if ($this->limitValue == ($i*30) . "," . ($i+1)*30): ?> selected="selected"<?php endif; ?> value="<?php echo $i*30; ?>,<?php echo ($i+1)*30; ?>"><?php echo $i*30+1; ?> - <?php echo ($i+1)*30; ?></option>
  <?php endfor; ?>
  <option<?php if ($this->limitValue == $i*30 . "," . $intResidue): ?> selected="selected"<?php endif; ?> value="<?php echo $i*30; ?>,<?php echo $intResidue; ?>"><?php echo $i*30+1; ?> - <?php echo $i*30+$intResidue; ?></option>
  <?php else: ?>
  <option selected="selected" value="0,30">1 - 30</option>
  <?php endif; ?>
  <option<?php if ($this->limitValue == "all"): ?> selected="selected"<?php endif; ?> value="all">All</option>
</select> 
</div>

<div class="tl_search tl_subpanel">
<strong>Order Status:</strong>
<select class="tl_select" name="tl_order_status" style="width:90px;">
  <option value=""></option>
  <option value="1"<?php if ($this->odr_status == "1"): ?> selected="selected"<?php endif; ?>>Pending</option>
  <option value="2"<?php if ($this->odr_status == "2"): ?> selected="selected"<?php endif; ?>>In progress</option>
  <option value="3"<?php if ($this->odr_status == "3"): ?> selected="selected"<?php endif; ?>>Shipping</option>
  <option value="4"<?php if ($this->odr_status == "4"): ?> selected="selected"<?php endif; ?>>Delivered</option>
  <option value="6"<?php if ($this->odr_status == "6"): ?> selected="selected"<?php endif; ?>>Cancelled</option>
</select>

<strong>Search:</strong>
<select class="tl_select" name="tl_order_search">
  <option value="orderno"<?php if ($this->order_search == "orderno"): ?> selected="selected"<?php endif; ?>>Order Number</option>
  <option value="id_member"<?php if ($this->order_search == "id_member"): ?> selected="selected"<?php endif; ?>>Email or First Name</option>
</select>
<span>=</span>
<input type="text" value="<?php echo $this->search_value; ?>" class="tl_text" name="tl_search_value">
</div>

<div class="clear"></div>

<div id="tl_buttons">
<a onclick="Backend.getScrollOffset();" title="Export orders by id" class="header_css_export_id" href="typolight/main.php?do=order&amp;key=export_id">Export by order number</a><!--  &nbsp; :: &nbsp; <a onclick="Backend.getScrollOffset();" title="Export orders by skuid" class="header_css_export_skuid" href="typolight/main.php?do=order&amp;key=export_skuid">Export by skuid</a>-->  &nbsp; :: &nbsp; 
<a onclick="Backend.getScrollOffset();" title="Order Invoice" class="header_css_invoice" href="typolight/main.php?do=invoice&amp;id_order=<?php echo $this->orderDetails[0]['id_order']; ?>">Order Invoice</a>
</div>

</div>
</div>
</form>
<?php if ($this->orderDetails): ?>
<div class="tl_listing_container">
	<div id="order_summery">
		<h2>ORDER #<?php echo $this->orderDetails[0]['orderno']; ?> <small>(Placed <?php echo date('m/d/Y H:i:s', strtotime($this->orderDetails[0]['placed_time'])); ?>)</small></h2>
		<div class="username_area">
			<ul>
				<li><a href="typolight/main.php?do=memberlist&act=detail&id=<?php echo $this->orderDetails[0]['id_member']; ?>" title="member detail"><?php echo $this->orderDetails[0]['firstname'] . '' . $this->orderDetails[0]['lastname']; ?></a></li>
				<li><?php echo $this->orderDetails[0]['email']; ?></li>
			</ul>
		</div>
		<div class="submitForm" style="width:40%;margin-bottom:10px;">
			<form name="tl_order_status" action="typolight/main.php?do=orderlist" class="tl_form" method="post">
				<input type="hidden" value="tl_order_status_change" name="FORM_SUBMIT">
				<input type="hidden" name="id_order" value="<?php echo $this->orderDetails[0]['id_order']; ?>" />
				<label><strong>Status</strong></label>&nbsp;
				<?php if ($this->orderDetails[0]['odr_status'] == "6"): ?>
				<label style="color:Red;">Cancelled</label>
				<div id="odr_cancel_comments"<?php if (!$this->orderDetails[0]['odr_can_com']): ?> style="display:none;"<?php endif; ?>>
					<textarea name="odr_can_com" cols="100" rows="5"><?php echo $this->orderDetails[0]['odr_can_com']; ?></textarea> 
				</div>
				<?php else: ?>
				<select name="order_status" class="tl_select active">
					<option value="1"<?php if ($this->orderDetails[0]['odr_status'] == '1'): ?> selected="selected"<?php endif; ?>>Payment pending</option>
					<option value="2"<?php if ($this->orderDetails[0]['odr_status'] == '2'): ?> selected="selected"<?php endif; ?>>Preparation in progress</option>
					<option value="3"<?php if ($this->orderDetails[0]['odr_status'] == '3'): ?> selected="selected"<?php endif; ?>>Shipping</option>
					<option value="4"<?php if ($this->orderDetails[0]['odr_status'] == '4'): ?> selected="selected"<?php endif; ?>>Delivered</option>
					<option value="6"<?php if ($this->orderDetails[0]['odr_status'] == "6"): ?> selected="selected"<?php endif; ?>>Cancelled</option>
				</select>
				<div class="submit_area" style="float:right;">
					<input type="submit" name="status_submit" value="submit" />
				</div>
				<div id="odr_cancel_comments"<?php if (!$this->orderDetails[0]['odr_can_com']): ?> style="display:none;"<?php endif; ?>>
					<textarea name="odr_can_com" cols="100" rows="5"><?php echo $this->orderDetails[0]['odr_can_com']; ?></textarea> 
				</div>
				<?php endif; ?>
			</form>
		</div>
		<ul class="order_method">
			<li>
				<h4>SHIPPING ADDRESS</h4>
				<p><?php echo $this->orderDetails[0]['firstname']; ?> <?php echo $this->orderDetails[0]['lastname']; ?>,<br />
				<?php echo $this->orderDetails[0]['shippingAddr']; ?> 
				<?php echo (($this->orderDetails[0]['shippingAddr2']=="line 2" || $this->orderDetails[0]['shippingAddr2']=="Address line 2") ? "" : "<br />".$this->orderDetails[0]['shippingAddr2']) . ", ".((!$this->orderDetails[0]['city'] || !$this->orderDetails[0]['state']) ? '' : (($this->arrCitys[$this->orderDetails[0]['city']]&&$this->orderDetails[0]['country']=='cn') ? $this->arrCitys[$this->orderDetails[0]['city']] : $this->orderDetails[0]['city']) . "<br />" . (($this->arrSates[$this->orderDetails[0]['state']]&&$this->orderDetails[0]['country']=='cn') ? $this->arrSates[$this->orderDetails[0]['state']] : $this->orderDetails[0]['state']) . "&nbsp;") . (($this->orderDetails[0]['postcode']) ? $this->orderDetails[0]['postcode'] ."&nbsp;" : ''). $this->arrCountries[$this->orderDetails[0]['country']]; ?></p>
			</li>
			<li>
				<h4>DEFAULT SHIPPING METHOD</h4>
				<?php if ($this->orderDetails[0]['shippings']):?>
				<p><small><?php echo $this->orderDetails[0]['shippings']['name']; ?></small></p>
				<?php echo $this->orderDetails[0]['shippings']['ship_des']; ?>
				<?php else: ?>
				<?php if ($this->orderDetails[0]['shipping_fee'] == "10.00"): ?><p><small>STANDARD DELIVERY (RMB<?php echo $this->orderDetails[0]['shipping_fee']; ?>)</small></p><?php elseif ($this->orderDetails[0]['shipping_fee'] == "0.00"): ?><p>STANDARD DELIVER (RMB 0.00 - free shopping till August 31)</p><?php else: ?><p>SAME DAY DELIVERY (SHANGHAI ONLY): RMB25.00</p><p><small>Your package will arrive within 24 hours after order is placed</small></p><?php endif; ?>
				<?php endif; ?>
			</li>
			<li>
				<h4>DEFAULT PAYMENT METHOD</h4>
				<p><?php if ($objOders->paymethod == 'COD'): ?>Cash on delivery (COD)<?php else: ?><?php echo $this->orderDetails[0]['paymethod']; ?><?php endif; ?></p>
			</li>
		</ul> <!-- order_method end -->
		<h3>ORDER SUMMERY</h3>
		<div class="order_detail_item" id="order_item_detail_area">
		<?php 
			$catalogFree = 0.00;
			$shippingFree = $this->orderDetails[0]['shippingFree'];
			$unitWrapping = $this->orderDetails[0]['wrapping_price'];
			$total_discounts = $this->orderDetails[0]['total_discounts'];
			
			$order_status = "";
			foreach ($this->orderDetails as $arrorderDetails)
			{			
				$unitWrapping = $arrorderDetails['wrapping_price'];
				if ($arrorderDetails['is_wrapping'])
					$detailTotal = number_format(($arrorderDetails['odrPrice'] + $unitWrapping) * $arrorderDetails['prod_quantity'], 2, '.', '');
				else
					$detailTotal = number_format(($arrorderDetails['odrPrice'] * $arrorderDetails['prod_quantity']), 2, '.', '');
				
				$catalogFree += $detailTotal;
				$order_status = $arrorderDetails['odr_status'];
			?>			
				<table id="odr_detail_item_<?php echo $arrorderDetails['order_detail_id']; ?>" class="cart_item">
					<input type="hidden" class="id_catalog" value="<?php echo $arrorderDetails['id_catalog']; ?>" />
					<input type="hidden" class="id_odr_detail_id" value="<?php echo $arrorderDetails['order_detail_id']; ?>" />
					<tr>
						<td rowspan="2" class="td_pic"><a href="<?php echo $this->basePath; ?>product.html?category=<?php echo $arrorderDetails['category']; ?>&id=<?php echo $arrorderDetails['id_catalog']; ?>&id_colour=<?php echo $arrorderDetails['id_color']; ?>&id_size=<?php echo $arrorderDetails['id_size']; ?>"><img src="<?php echo $this->basePath; ?>image.php?src=<?php echo $arrorderDetails['imagePath']; ?>&width=79&height=79" alt="" /></a></td>
						<td class="td_info">
							<h4><a href="<?php echo $this->basePath; ?>product.html?category=<?php echo $arrorderDetails['category']; ?>&id=<?php echo $arrorderDetails['id_catalog']; ?>&id_colour=<?php echo $arrorderDetails['id_color']; ?>&id_size=<?php echo $arrorderDetails['id_size']; ?>"><?php echo $arrorderDetails['catalogName']; ?></a></h4>
							<small>SKU <span style="color:red;">#<?php echo $arrorderDetails['skuid']; ?></span></small><br />
							<small><label><?php echo $this->obj_currency->change_order($arrorderDetails['odrPrice'],$arrorderDetails['iso_code']); ?></label></small><?php if ($arrorderDetails['is_wrapping']): ?><br /><small><?php echo $this->obj_currency->change_order($unitWrapping,$arrorderDetails['iso_code']); ?> </small><?php endif; ?>
						</td>
						<td rowspan="2" class="td_skin">
							<div class="skin">
								<p>
									<label><strong>COLOR</strong></label>
									<!--<span class="skin_value">
										<?php if ($arrorderDetails['odr_status'] == '1'): ?>
											<select class="skin_colour" name="item_colour[<?php echo $arrorderDetails['id_catalog']; ?>_<?php echo $arrorderDetails['order_detail_id']; ?>]">
												<?php foreach ($arrorderDetails['colours'] as $key=>$arr_colours): ?>
												<option value="<?php echo $key; ?>"><?php echo $arr_colours; ?></option>
												<?php endforeach; ?>
											</select>
										<?php else: ?><?php echo $arrorderDetails['colorName']; ?>
										<?php endif; ?>
									</span>-->
									<span class="skin_value">
										<?php echo $arrorderDetails['colorName']; ?>
									</span>
								</p>
								<p>
									<label><strong>SIZE</strong></label>
									<!--<span class="skin_value">
									<?php if ($arrorderDetails['odr_status'] == '1'): ?>
										<input type="hidden" class="default_size" value="<?php echo $arrorderDetails['id_size'] ? $arrorderDetails['id_size'] : 0; ?>" />
										<select class="skin_size" name="item_size[<?php echo $arrorderDetails['id_catalog']; ?>_<?php echo $arrorderDetails['order_detail_id']; ?>]">
											<option<?php if (!$arrorderDetails['id_size']): ?> selected="selected"<?php endif; ?> value="">- SELECT SIZE -</option>
											<?php foreach ($arrorderDetails['sizes'] as $key=>$arr_sizes): ?>
											<option<?php if ($arrorderDetails['id_size'] == $key): ?> selected="selected"<?php endif; ?> value="<?php echo $key; ?>"><?php echo $arr_sizes; ?></option>
											<?php endforeach; ?>
										</select>
									<?php else: ?><?php echo $arrorderDetails['sizeName']; ?>
									<?php endif; ?></span>-->
									<span class="skin_value">
										<?php echo $arrorderDetails['sizeName']; ?>
									</span>
								</p>
								<p>
									<label><strong>QUANTITY</strong></label>
									<?php /*if ($arrorderDetails['odr_status'] == '1' && $arrorderDetails['catalog_stock']): ?>
									<span class="skin_value">
									<select class="skin_quantity" name="item_quantity[<?php echo $arrorderDetails['id_catalog']; ?>_<?php echo $arrorderDetails['order_detail_id']; ?>]">
										<?php if ($arrorderDetails['catalog_stock'] > 10): ?>
										<?php $total_quantity = 10; ?>
										<?php else: ?>
										<?php $total_quantity = intval($arrorderDetails['catalog_stock']); ?>
										<?php endif; ?>
										<option value="">- SELECT QUANTITY -</option>
										<?php for ($i=1;$i<=$total_quantity;$i++): ?>
											<option<?php if ($i == $arrorderDetails['prod_quantity']): ?> selected="selected"<?php endif; ?> value="<?php echo $i; ?>"><?php echo $i; ?></option>
										<?php endfor; ?>
									</select>
									<input type="hidden" class="default_quantity" value="<?php echo $arrorderDetails['prod_quantity']; ?>" />
									</span>
									<?php else: ?>
									<span class="skin_value"><?php echo $arrorderDetails['prod_quantity']; ?></span><?php endif;*/ ?>
									<span class="skin_value"><?php echo $arrorderDetails['prod_quantity']; ?></span>
								</p>
							</div>
						</td>
						<?php /*if ($arrorderDetails['odr_status'] == '1'): ?>
						<td rowspan="2" class="unit_price">
							<label><strong>UNIT PRICE</strong></label>
							<input type="text" name="item_price[<?php echo $arrorderDetails['id_catalog']; ?>_<?php echo $arrorderDetails['order_detail_id']; ?>]" value="<?php echo number_format($arrorderDetails['odrPrice'], 2, '.', ''); ?>" />
						</td>
						<?php endif;*/ ?>
						<td rowspan="2" class="total_item"><strong><label><?php echo $this->obj_currency->change_order($detailTotal,$arrorderDetails['iso_code']); ?></label></strong></td>
						<?php if ($arrorderDetails['odr_status'] == '1'): ?><td rowspan="2" class="del_columns"><a href="javascript:void(0);" title="delete" class="odr_delete"><img src="system/themes/default/images/delete.gif" alt="delete" /></a></td><?php endif; ?>
					</tr>
				</table>				
			<?php
			}
		?>
		</div>
		<?php if ($arrorderDetails['odr_status'] == '1'): ?>
		<!--<table class="add_item">
			<tr>
				<td><input type="text" name="item_skuid" value="" /></td>
				<td><input type="button" name="add_item" value="Add New Item" /></td>
			</tr>
		</table>-->
		<?php endif; ?>
		<script type="text/javascript">
			window.addEvent('domready',function(){
				$$('input[name="add_item"]').addEvent("click",function(el){
					// add item by skuid.
					var _target = $(el.target) || $(el);
					var _target_skuid = _target.getParent("td").getPrevious().getElement("input[name^=item_skuid]");
					if (!_target_skuid.value)
						return false;
					
					var _last_cart_item = $$('.cart_item').getLast();							
					new Request(
					{
						url: window.location.href,
						data: 'action=loadcatalog&skuid='+_target_skuid.value,
						onRequest: AjaxRequest.displayBox('Loading data …'),
						onComplete: function(txt, xml)
						{
							var _new_cart_item = new Element('table', {'class': 'cart_item', 'html' : txt});
							_new_cart_item.inject(_last_cart_item, 'after');
							/** 改变subtotal和total **/
							var _subtotal = $('subItem_total').getElement('label');
							var _odr_total_paid = $('odr_total_paid');
							var _odr_shipping_fee = $('odr_shipping_fee').getElement('label');
							var _odr_discount_fee = $('odr_total_discount') ? $('odr_total_discount').getElement('label').innerHTML : '';
							
							var _total_item_list = "";
							var subtotal_value = 0;
							$$('table.cart_item').each(function(item, index){
								_total_item_list = $(item);
								subtotal_value += _total_item_list.getElement('td.total_item').getElement('label').innerHTML.toInt();
							});
							_subtotal.innerHTML = subtotal_value.toFixed(2);
							_odr_total_paid.innerHTML = (subtotal_value + _odr_shipping_fee.innerHTML.toInt() + (_odr_discount_fee ? _odr_discount_fee.toInt() : 0)).toFixed(2);
							/** end **/
							AjaxRequest.hideBox();
						}
					}).send();
				});
				/** 颜色变化处理时间 **/
				$$('.order_detail_item').addEvent("change",function(el){
					var _target = $(el.target) || $(el);
					if (_target.hasClass('skin_colour')){
						var _order_detail_item = _target.getParent("p").getParent('table.cart_item');
						var _span_size = _target.getParent('p').getNext().getElement("span.skin_value");
						var _default_size_value = _span_size.getElement('input.default_size') ? _span_size.getElement('input.default_size').value : '';
						var _catalog_id = _order_detail_item.getElement("input.id_catalog").value;
						var _odr_detail_id = _order_detail_item.getElement("input.id_odr_detail_id").value;
						
						new Request(
						{
							url: window.location.href,
							data: 'action=loadCatalogSize&default_size='+_default_size_value+'&detail_id='+_odr_detail_id+'&id_catalog=' + _catalog_id + '&id_colour=' + _target.value,
							onRequest: AjaxRequest.displayBox('Loading data …'),
							onComplete: function(txt, xml)
							{
								_span_size.innerHTML = txt;
								AjaxRequest.hideBox();
							}
						}).send();
					}else if (_target.hasClass('skin_size')){
						var _order_detail_item = _target.getParent("p").getParent('table.cart_item');
						var _span_quantity = _target.getParent('p').getNext().getElement("span.skin_value");
						var _default_quantity_value = _span_quantity.getElement('input.default_quantity') ? _span_quantity.getElement('input.default_quantity').value : '';
						var _catalog_id = _order_detail_item.getElement("input.id_catalog").value;
						var _odr_detail_id = _order_detail_item.getElement("input.id_odr_detail_id").value;
						var _catalog_color =  _target.getParent('p').getPrevious().getElement("select.skin_colour").value;
						
						if (!_target.value)
							return false;
							
						new Request(
						{
							url: window.location.href,
							data: 'action=loadCatalogQuantity&defalut_quantity='+_default_quantity_value+'&id_size='+_target.value+'&detail_id='+_odr_detail_id+'&id_catalog=' + _catalog_id + '&id_colour=' + _catalog_color,
							onRequest: AjaxRequest.displayBox('Loading data …'),
							onComplete: function(txt, xml)
							{
								_span_quantity.innerHTML = txt;
								AjaxRequest.hideBox();
							}
						}).send();
					}else if (_target.hasClass('skin_quantity')){
						var _total_item_info = _target.getParent("table").getElement("td.td_info").getElement("label");
						var _total_item = _target.getParent("table").getElement('td.total_item').getElement("label");
						var _unit_price = _target.getParent("table").getElement('td.unit_price').getElement("input[name^=item_price[]");
						/** 改变subtotal和total **/
						var _subtotal = $('subItem_total').getElement('label');
						var _odr_total_paid = $('odr_total_paid');
						var _odr_shipping_fee = $('odr_shipping_fee').getElement('label');
						var _odr_discount_fee = $('odr_total_discount') ? $('odr_total_discount').getElement('label').innerHTML : '';
						
						if (_target.value){
							var _total_item_value = (_target.value.toInt() * _unit_price.value.toInt()).toFixed(2);
							_total_item.innerHTML = _total_item_value;
							_total_item_info.innerHTML = _total_item_value;
							var _total_item_list = "";
							var subtotal_value = 0;
							$$('table.cart_item').each(function(item, index){
								_total_item_list = $(item);
								subtotal_value += _total_item_list.getElement('td.total_item').getElement('label').innerHTML.toInt();
							});
							_subtotal.innerHTML = subtotal_value.toFixed(2);
							_odr_total_paid.innerHTML = (subtotal_value + _odr_shipping_fee.innerHTML.toInt() + (_odr_discount_fee ? _odr_discount_fee.toInt() : 0)).toFixed(2);
						}
						/** end **/
					}
				});
				/** 改变价格选择器 **/
				$$("td.unit_price").addEvent('change',function(el){
					var _target = $(el.target) || $(el);
					if (_target.name.indexOf('item_price[') > -1){
						var _node_quantity = _target.getParent("td").getPrevious().getElement("select.skin_quantity");
						var _quantity = _node_quantity? _node_quantity.value : '';
						
						if (_quantity){
							var _total_item = _target.getParent("td").getNext().getElement("label");
							var _total_item_info = _target.getParent("table").getElement("td.td_info").getElement("label");
							var _total_item_value = (_target.value.toInt() * _quantity.toInt()).toFixed(2);
							_total_item.innerHTML = _total_item_value;
							_total_item_info.innerHTML = _total_item_value;
						}
					}
				});
				
				/** 保存修改订单 **/
				$$('input[name^=update_odr]').addEvent('click',function(el){
					var _target = $(el.target) || $(el);
					new Request(
					{
						url: window.location.href,
						data: 'action=update_order_item&'+$('order_item_detail_area').toQueryString(),
						onRequest: AjaxRequest.displayBox('Loading data …'),
						onComplete: function(txt, xml)
						{
							var _txt = eval(txt);
							alert(_txt[0].msg);
							AjaxRequest.hideBox();
							if (_txt[0].res == 'succ'){
								window.location = window.location.href;
							}
						}
					}).send();
				});
				
				/** 保存订单备注 **/
				$$('input[name^=update_comments]').addEvent('click',function(el){
					var _target = $(el.target) || $(el);
					new Request(
					{
						url: window.location.href,
						data: 'action=update_order_comments'+'&id_order='+$$('input[name^=id_order]')[0].value+'&odr_status_comments='+$$('textarea[name^=odr_status_comments]')[0].value,
						onRequest: AjaxRequest.displayBox('Loading data …'),
						onComplete: function(txt, xml)
						{
							AjaxRequest.hideBox();
							window.location = window.location.href;
						}
					}).send();
				});
			});
		</script>
		<div class="count_price">
			<p>SUBTOTAL: <span id="subItem_total"><label><?php echo $this->obj_currency->change_order($catalogFree,$arrorderDetails['iso_code']); ?></label></span></p>
			<p>SHIPPING: <span id="odr_shipping_fee"><label><?php echo $this->obj_currency->change_order($shippingFree,$arrorderDetails['iso_code']); ?></label></span></p>
			<?php if ($total_discounts > 0): ?> <p class="order_givevoucher">GIFT VOUCHER: <span id="odr_total_discount">- <label><?php echo $this->obj_currency->change_order($total_discounts,$arrorderDetails['iso_code']); ?><label></span></p><?php endif; ?>
		</div> <!-- order_price end -->
		<div class="total_price">
			<small>TOTAL //</small>
			<span id="odr_total_paid"><?php echo $this->obj_currency->change_order(($catalogFree + $shippingFree - $total_discounts),$arrorderDetails['iso_code']); ?></span>
		</div> <!-- total_price end -->
		<?php if ($arrorderDetails['odr_status'] == '1'): ?><!--<div class="submit_items_area"><input type="button" name="update_odr" value="UPDATE ORDER" /></div>--><?php endif; ?>		
		<div class="order_comments">
			<small>ORDER CANCEL COMMENTS</small>
			<p>
				<textarea name="odr_status_comments" class="comments" rows="5" cols="50"><?php echo str_replace("\n", "<br />", $arrorderDetails['odr_status_comments']); ?></textarea>
			</p>
		</div><!-- order comments -->
		<?php if (str_replace("\n", "<br />", $arrorderDetails['comments']) != 'FOR EXAMPLE: PLEASE DELIVER BETWEEN 7 AND 9PM IN THE EVENING' && str_replace(" ", "", $arrorderDetails['comments']) != "" && str_replace("\n", "", $arrorderDetails['comments']) != "" && $arrorderDetails['comments'] != ""): ?>
		<div class="order_comments">
			<small>ANY COMMENT OR SPECIAL REQUEST?</small>
			<p>
				<?php echo str_replace("\n", "<br />", $arrorderDetails['comments']); ?>
			</p>
		</div><!-- order comments -->
		<?php endif; ?>
		<div class="submit_comments_area"><input type="button" name="update_comments" value="UPDATE ORDER COMMENTS" /></div>
	</div>
</div>
<?php endif; ?>